local dunxi = fk.CreateSkill {
  name = "wk_heg__dunxi",
}

Fk:loadTranslationTable{
  ["wk_heg__dunxi"] = "钝袭",
  [":wk_heg__dunxi"] = "每回合限一次，当你造成伤害时，你可以防止此伤害，弃置受伤角色四张牌，然后其摸两张牌。",

  ["$wk_heg__dunxi1"] = "看锤！",
  ["$wk_heg__dunxi2"] = "且吃我一锤！",
}

dunxi:addEffect(fk.DetermineDamageCaused, {
  anim_type = "special",
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(dunxi.name) and player:usedSkillTimes(dunxi.name, Player.HistoryTurn) == 0 and player == target
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    data:preventDamage()
    if #data.to:getCardIds("he") < 4 then
      data.to:throwAllCards("he")
    else
      local id = room:askToChooseCards(player,{
          target = data.to,
          min = 4,
          max = 4,
          flag = "he",
          skill_name = dunxi.name,
      })
      room:throwCard(id, dunxi.name, data.to, player)
    end
    data.to:drawCards(2, dunxi.name)
  end,
})

return dunxi